home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 6975
- ClientLeft = -30
- ClientTop = 1695
- ClientWidth = 8685
- Height = 7380
- Left = -90
- LinkTopic = "Form1"
- ScaleHeight = 6975
- ScaleWidth = 8685
- Top = 1350
- Width = 8805
- Begin VB.TextBox txtSize
- Height = 285
- Left = 4680
- TabIndex = 4
- Text = "12"
- Top = 120
- Width = 495
- End
- Begin VB.TextBox txtDegree
- Height = 285
- Left = 2520
- TabIndex = 2
- Text = "90"
- Top = 120
- Width = 615
- End
- Begin VB.CommandButton Command1
- Caption = "Write"
- Height = 375
- Left = 360
- TabIndex = 0
- Top = 120
- Width = 975
- End
- Begin VB.Label Label2
- Caption = "Size"
- Height = 255
- Left = 3480
- TabIndex = 3
- Top = 120
- Width = 975
- End
- Begin VB.Label Label1
- Caption = "Degrees"
- Height = 255
- Left = 1560
- TabIndex = 1
- Top = 120
- Width = 855
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Type LOGFONT
- lfHeight As Long
- lfWidth As Long
- lfEscapement As Long
- lfOrientation As Long
- lfWeight As Long
- lfItalic As Byte
- lfUnderline As Byte
- lfStrikeOut As Byte
- lfCharSet As Byte
- lfOutPrecision As Byte
- lfClipPrecision As Byte
- lfQuality As Byte
- lfPitchAndFamily As Byte
- ' lfFaceName(LF_FACESIZE) As Byte 'THIS WAS DEFINED IN API-CHANGES MY OWN
- lfFacename As String * 33
- End Type
- Private Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long
- Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
- Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
- Private Sub CheckVals()
- Command1.Enabled = ((Val(txtDegree.Text) < 360) And Val(txtsize.Text) > 7)
- End Sub
- Private Sub FontStuff()
- On Error GoTo GetOut
- Dim F As LOGFONT, hPrevFont As Long, hFont As Long, FontName As String
- Dim FONTSIZE As Integer
- FONTSIZE = Val(txtsize.Text)
- F.lfEscapement = 10 * Val(txtDegree.Text) 'rotation angle, in tenths
- FontName = "Arial Black" + Chr$(0) 'null terminated
- F.lfFacename = FontName
- F.lfHeight = (FONTSIZE * -20) / Screen.TwipsPerPixelY
- hFont = CreateFontIndirect(F)
- hPrevFont = SelectObject(Me.hdc, hFont)
- CurrentX = 3930
- CurrentY = 3860
- Print "Funny Font"
- ' Clean up, restore original font
- hFont = SelectObject(Me.hdc, hPrevFont)
- DeleteObject hFont
- Exit Sub
- GetOut:
- Exit Sub
- End Sub
- Private Sub Command1_Click()
- Me.Cls
- FontStuff
- End Sub
- Private Sub Form_Load()
- '**********************************************************
- 'This file passed trought:
- 'K.Driblinov prg page... tons of C & Vb sources, links to
- 'other prg sites!!
- 'http://www.geocities.com/SiliconValley/Lakes/7057/index.htm
- 'E-Mail: kdriblinov@hotmail.com
- '***********************************************************
- End Sub
- Private Sub txtDegree_Change()
- If Not IsNumeric(txtDegree.Text) Then txtDegree.Text = "90"
- CheckVals
- End Sub
- Private Sub txtsize_Change()
- If Not IsNumeric(txtsize.Text) Then txtsize.Text = "18"
- CheckVals
- End Sub
-